package com.kaifamiao.N0721;

public class Node3 {
    public static void main(String[] args) {
        int[] arr = {2, 3, 4, 5, 6, 7};
        int index = 2;
        int[] newArr = new int[arr.length - 1];
        //删除数组中下标为2的元素
        for (int i = 0, j = 0; i < arr.length; i++) {
            if (i == index) {
                continue;
            }
            newArr[j++] = arr[i];
        }
        for (int i = 0; i < newArr.length; i++) {
            System.out.println(newArr[i]);
        }
    }
}